//
//  OADianZiJiaoYiDetailsVC.m
//  OA项目
//
//  Created by innofive on 2018/4/18.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OADianZiJiaoYiDetailsVC.h"
#import "OAApprovelistCell.h"
#import "OAApproveRejectedVC.h"
@interface OADianZiJiaoYiDetailsVC ()

@end

@implementation OADianZiJiaoYiDetailsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *arr = @[
                     @{@"name1":@"审批状态",@"name2":@"待审批"},
                     @{@"name1":@"代理合同编号",@"name2":@"AAA50076849"},
                     @{@"name1":@"代理合同名称",@"name2":@"广州微视人企业管理咨询有限公司招标代理合同"},
                     @{@"name1":@"招标人",@"name2":@"广汽本田汽车有限公司"},
                     @{@"name1":@"受托方",@"name2":@"广东省机电设备招标中心有限公司"},
                     @{@"name1":@"代理费用支付",@"name2":@"中标人"},
                     @{@"name1":@"计费方式",@"name2":@"国家标准收费"},
                     @{@"name1":@"服务费折扣率",@"name2":@"100%"},
                     @{@"name1":@"代理合同类型",@"name2":@"单项"},
                     @{@"name1":@"所属地区",@"name2":@"广东省 广州市"},
                     @{@"name1":@"合同签订日期",@"name2":@"2017-09-30"},
                     @{@"name1":@"需要法人盖章",@"name2":@"否"},
                     @{@"name1":@"招标内容",@"name2":@"机电设备"},
                     @{@"name1":@"受理部分",@"name2":@"招标三部"},
                     @{@"name1":@"上传附件",@"name2":@""},
                     @{@"name1":@"附件",@"name2":@""},
                     @{@"name1":@"",@"name2":@""},
                     @{@"name1":@"已审批人",@"name2":@"无"},
                     @{@"name1":@"提交经济负责任",@"name2":@"小小"},
                     @{@"name1":@"提交副主任审批",@"name2":@"小小"},
                     @{@"name1":@"",@"name2":@""},
                     ];
    
    [self.dataArr addObjectsFromArray:arr];
}

-(void)onLoadViewByWillAppear:(UIView *)view
{
    [self.tableView config:^(UITableView *tableView) {
        [tableView setSeparatorMan];
    }];
}

#pragma mark - 点击方法

-(void)onClick:(UIButton *)button
{
    
    OAApproveRejectedVC *vc =[OAApproveRejectedVC rejectedVCForType:button.tag==20?openVCTypeOne:openVCTypeTwo];
    
    [self presentWindowToVC:vc IsNaV:NO Completion:^{
        
    }];
}

-(void)onUpdateCell:(UITableViewCell *)cell model:(id)model atIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==self.dataArr.count-2||indexPath.row==self.dataArr.count-3||indexPath.row==self.dataArr.count-4) {
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    else if (indexPath.row==self.dataArr.count-5)
    {
        cell.backgroundColor = [UIColor clearColor];
    }
    else
    {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    
    [super onUpdateCell:cell model:model atIndexPath:indexPath];
}

-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    if (indexPath.row==self.dataArr.count-1)
    {
        return [MCCellInfo configForCellId:cell3 Class:[OAApproveDetailsCell3_0 class] Height:kFitH(85) TableView:tableView];
    }
    else if (indexPath.row==self.dataArr.count-5)
    {
        return [MCCellInfo configForCellId:cell2 Class:[BaseTableViewCell class] Height:kFitH(10) TableView:tableView];
    }
    return [MCCellInfo configForCellId:cell Class:[OAApproveDetailsCell class] Height:kFitH(40) TableView:tableView];
}

@end
